#ifndef __AOT_DATA_OP_SHEDULE_OP_H__  
#define __AOT_DATA_OP_SHEDULE_OP_H__

#include <interface/data_op/shedule.h>

namespace aot{ namespace data{

class shedule_info_impl : public ishedule_info
{
public:
    virtual ~shedule_info_impl (){;}
    shedule_info_impl()
    {
        title = &title_impl;
        datetime_begin = &datetime_begin_impl;
        datetime_end = &datetime_end_impl;
        recv_number = &recv_number_impl;
        content = &content_impl;

        id = 0;
        type_call = 0;
        type_meeting = 0;
        type_private = 0;
        is_full_day = 0;
        notify_mode_tata = 0;
        notify_mode_sms = 0;
        notify_mode_email = 0;
        interval = 0;
    }
public:
    virtual  bool clone(ishedule_info** out) 
    {
        shedule_info_impl* p = new shedule_info_impl();
        *out = p;
        return p->assign(this);
    }
    virtual  bool assign(const ishedule_info* in) 
    {
        if (NULL==in)
            return false;

        shedule_info_impl* p = (shedule_info_impl*) in;
        *this = *p;

        title = &title_impl;
        datetime_begin = &datetime_begin_impl;
        datetime_end = &datetime_end_impl;
        recv_number = &recv_number_impl;
        content = &content_impl;

        return true;
    }
public:
    aot::tt::str_impl title_impl;
    aot::tt::str_impl datetime_begin_impl;
    aot::tt::str_impl datetime_end_impl;
    aot::tt::str_impl recv_number_impl;
    aot::tt::str_impl content_impl;
};


class shedule_op_impl : public aot::data::ishedule_op
{
public:
    shedule_op_impl(void);
public:
    virtual ~shedule_op_impl(void);
public:    
    virtual bool insert(const ishedule_info* p, int& new_id);
    virtual bool del(int id); 
    virtual bool update(const ishedule_info* p);
    virtual bool read(int id, isqlite3_table** out);
    virtual bool read(int id, ishedule_info* out);
    virtual bool read(int id, ishedule_info** out);
};

}} /* end namespace aot/data*/

#endif // __AOT_DATA_OP_SHEDULE_OP_H__
